-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Prevent deadlock during shutdown by not holding GraphUpdate mutex
#20715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a deadlock issue that can occur during application shutdown when Level Zero (L0) calls exit() while command enqueue operations are in progress. The fix introduces checks using GlobalHandler::instance().isOkToDefer() to avoid strict lock acquisition during shutdown scenarios.
- Adds shutdown-aware checks before attempting host memory updates
- Modifies
removeMemoryObjectcall to accept a parameter indicating whether strict locking is required - Updates assertion logic to account for potential failures during shutdown
|
|
||
| void SYCLMemObjT::updateHostMemory() { | ||
| if ((MUploadDataFunctor != nullptr) && MNeedWriteBack) | ||
| // Don't try updating host memory when stutting down. |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'stutting' to 'shutting'.
| // Don't try updating host memory when stutting down. | |
| // Don't try updating host memory when shutting down. |
| std::ignore = Result; // for no assert build | ||
|
|
||
| // removeMemoryObject might fail during shutdown because of not being | ||
| // able to hold write lock. This can happen if shutdown happen due to |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected grammar: 'shutdown happen' should be 'shutdown happens'.
| // able to hold write lock. This can happen if shutdown happen due to | |
| // able to hold write lock. This can happen if shutdown happens due to |
Deadlock can happen if L0 calls
exit()while we are in the middle of enqueuing a command.